/*
 *    Copyright 2011-2012 The Hook Team
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.hook.yaksha;

/**
 * 常量定义
 * 
 * @author suwuqiang 2011-12-26
 */
public class AnalysisConstants {
	public final static String IGNORE_PROCESS = "ignore";// 用于系统内部过滤不符合条件的key
	public final static String GLOBAL_KEY_STR = "GLOBAL_KEY";// 定义在报表中的全局key，作为对所有记录作全局统计用，也就是没有key做统计
	public final static String RECORD_LENGTH = "RECORD_LENGTH";// 定义在报表过滤条件中，用于过滤切割后记录数是否符合条件
	public final static Integer GLOBAL_KEY = -2;

	// condition的条件设置
	public final static byte CONDITION_EQUAL = 0x1;
	public final static byte CONDITION_NOT_EQUAL = 0x2;
	public final static byte CONDITION_GREATER = 0x3;
	public final static byte CONDITION_LESSER = 0x4;
	public final static byte CONDITION_EQUALORGREATER = 0x5;
	public final static byte CONDITION_EQUALORLESSER = 0x6;
	public final static byte CONDITION_ISNUMBER = 0x7;

	public final static byte OPERATE_PLUS = 0x11;
	public final static byte OPERATE_MINUS = 0x12;
	public final static byte OPERATE_DIVIDE = 0x13;
	public final static byte OPERATE_RIDE = 0x14;

	public final static String CONDITION_EQUAL_STR = "=";
	public final static String CONDITION_NOT_EQUAL_STR = "!=";
	public final static String CONDITION_GREATER_STR = ">";
	public final static String CONDITION_LESSER_STR = "<";
	public final static String CONDITION_EQUALORGREATER_STR = ">=";
	public final static String CONDITION_EQUALORLESSER_STR = "<=";
	public final static String CONDITION_ISNUMBER_STR = "isnumber";// 是否是数字
	public final static String CONDITION_ROUND_STR = "round:";// 是否需要保留几位小数

	public final static char OPERATE_PLUS_CHAR = '+';
	public final static char OPERATE_MINUS_CHAR = '-';
	public final static char OPERATE_DIVIDE_CHAR = '/';
	public final static char OPERATE_RIDE_CHAR = '*';

	// 报表中的特殊字符
	public final static String PREF_SUM = "_:s";
	public final static String PREF_COUNT = "_:c";
	public final static String SPLIT_KEY = "--";
	public final static String RETURN = "\r\n";
	public final static String REPLACE_PREFIX = ":i";

	// 用于导出数据的私有分隔符
	public final static String EXPORT_RECORD_SPLIT = "<->";
	public final static String EXPORT_COLUMN_SPLIT = "(!)";
	public final static String EXPORT_DOUBLE_SPLIT = "d(!)";

	// 导出文件的后缀名
	public final static String INNER_DATAFILE_SUFFIX = ".idata";
	public final static String IBCK_DATAFILE_SUFFIX = ".ibck";

	public final static String CHART_FILENAME = "topanalysis.html";
	public final static String DATA_RESULT = "topresult.data";
	public final static String DATA_JOBSTATUSPOOL = "topjobstatus.data";
	public final static String DATA_JOBS = "topjobs.data";
	public final static String TIMESTAMP_FILE = "analysis.timestamp";

	public final static String JOBFILEFROM_FTP = "ftp";
	public final static String JOBFILEFROM_MACHINE = "machine";

	public final static String JOBMANAGER_EVENT_LOADDATA = "loadData";
	public final static String JOBMANAGER_EVENT_LOADDATA_TO_TMP = "loadDataToTmp";
	public final static String JOBMANAGER_EVENT_EXPORTDATA = "exportData";
	public final static String JOBMANAGER_EVENT_SETNULL_EXPORTDATA = "setNullexportData";
	public final static String JOBMANAGER_EVENT_DEL_DATAFILE = "delDataFile";

	public final static String REPORT_PERIOD_HOUR = "hour";
	public final static String REPORT_PERIOD_DAY = "day";
	public final static String REPORT_PERIOD_MONTH = "month";
}